import java.util.ArrayList;

import pluginUtils.Complexe;
import pluginUtils.DoyleCircle;


public class MyArrayList<T> extends ArrayList<DoyleCircle> {
	
	public boolean contains(Object oc){
		DoyleCircle c=(DoyleCircle)oc;
		//System.out.println("pass");
		Complexe cc=Complexe.createComplexeFromRI(c.getXcenter(),c.getYcenter()); 
		for(DoyleCircle e: this){
			Complexe ce=Complexe.createComplexeFromRI(e.getXcenter(),e.getYcenter());
			double dis=Complexe.distance(cc,ce);
			if((dis<c.getRadius())&&(dis<e.getRadius())) {
				this.remove(e); 
				super.add(c); 
				return true; 
			}
		} 
		return false; 
	}
}
		